﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BONGDA
{
    public partial class frmDangLapLichThiDau : Form
    {
        const int speed = 3;
        int count = 0;
        PictureBox[] listPicture;
        public frmDangLapLichThiDau()
        {
            InitializeComponent();
            listPicture = new PictureBox[20];
            string[] images = Directory.GetFiles(@"logo", "*.png");

            for (int i = 0; i < 20; i++)
            {
                Image image = Image.FromFile(images[i]);
                listPicture[i] = new PictureBox();
                listPicture[i].Image = image;
                listPicture[i].Location = new System.Drawing.Point(-630 + i * (150 + 10), 70);
                listPicture[i].Name = "pictureBox" + i;
                listPicture[i].Size = new System.Drawing.Size(150, 150);
                listPicture[i].SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
                listPicture[i].BackColor = Color.Transparent;
                listPicture[i].Visible = true;
                //picture.TabIndex = 0;
                //picture.TabStop = false;
                panel1.Controls.Add(listPicture[i]);
            }
        }

        private void frmDangLapLichThiDau_Load(object sender, EventArgs e)
        {
            moveTimer.Interval = 1;
            moveTimer.Tick += new EventHandler(moveTimer_Tick);
            moveTimer.Start();
        }

        private void moveTimer_Tick(object sender, EventArgs e)
        {
            for (int i = 0; i < 20; i++)
            {
                listPicture[i].Left -= speed;
                if (listPicture[i].Left == -790)
                {
                    listPicture[i].Left = 2410;
                }
            }
            count++;
            
        }
    }
}
